#ifndef FILETRANSFERMGRDLG_H
#define FILETRANSFERMGRDLG_H
#include "../Core/msgbus_interface.h"
#include "../Core/msgbus_handlerbase.hpp"
#include <map>
#include <string>
#include <QDialog>
#include "filetransferitem.h"
#include "offlinefiletransferitem.h"

using std::string;
using std::map;

namespace Ui {
    class FileTransferMgrDlg;
}

class FileTransferMgrDlg : public QDialog
{
    Q_OBJECT

public:
    explicit FileTransferMgrDlg(QWidget *parent = 0);
    ~FileTransferMgrDlg();

    void AddNewTransferSession(std::string sessionid, FileTransferNotify data);
    void AddNewOfflineTransferSession(std::string sessionid, CSFileTransferNotify data);
    void DeletTransferSession(std::string sessionid);

    void OnDoNotifyOtherSide(MsgBusParam param);
    void OnDoOfflineNotifyOtherSide(MsgBusParam param);
    void ClearAllSession();

public slots:
    void OnFileTransferNotify(MsgBusParam param);
    void OnOfflineFileNotify(MsgBusParam param);
    void OnDoNotifyOtherSide(FileTransferNotify notifydata);
    void OnDoOfflineNotifyOtherSide(CSFileTransferNotify notifydata);
    void AcceptAll();
    void RejectAll();
    void OnTransferActivity();

signals:
    void doNotifyOtherSide(MsgBusParam param);
    void doOfflineNotifyOtherSide(MsgBusParam param);
    void newactivity();

private:


    Ui::FileTransferMgrDlg *ui;
    std::map<std::string, FileTransferItem*> m_all_transfer_sessions;
    std::map<std::string, OfflineFileTransferItem*> m_all_offline_transfer_sessions;
};

#endif // FILETRANSFERMGRDLG_H
